package leecode

func rotate48(matrix [][]int) {
	temp := make([][]int, len(matrix))
	for i := 0; i < len(temp); i++ {
		temp[i] = make([]int, len(matrix[i]))
	}
	for i := 0; i < len(matrix); i++ {
		for j := 0; j < len(matrix[i]); j++ {
			temp[i][j] = matrix[len(matrix)-j-1][i]
		}
	}
	for i := 0; i < len(matrix); i++ {
		for j := 0; j < len(matrix[i]); j++ {
			matrix[i][j] = temp[i][j]
		}
	}
}
